#include <stdio.h>

/* 算法1-6：计算1~n与1~m每一项相互乘积的和 SumProducts(n,m) */
int SumProducts(int n, int m) {
    int i, j, sum;

    sum = 0;
    for (i = 1; i <= n; i++) { /* 对1~n的每一项  */
        for (j = 1; j <= m; j++) { /* 对1~m的每一项  */
            sum += (i * j); /* 计算相互乘积的和 */
        }
    }
    return sum;
}
/* 算法1-6 结束 */

int main(void) {
    int n, m;

    scanf("%d %d", &n, &m);
    printf("%d\n", SumProducts(n, m));

    return 0;
}